package com.couldtest.consumerFeign.controller;

import com.couldtest.consumerFeign.client.DcClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by liguanfu on 2018/6/7.
 */
@RestController
public class DcController {

    @Autowired
    DcClient dcClient;

    @GetMapping("/consumer")
    public String dc(@RequestParam("id") String id) {
        String consumer = dcClient.consumer(id);
        System.out.println(consumer);
        return consumer;
    }

    @GetMapping("/consumer1")
    public String dc1(@RequestParam("id") String id , @RequestParam("name") String name) {
        String s = dcClient.dcx1(id, name);
        System.out.println(s);
        return s;
    }

    @GetMapping("/consumer2")
    public String dc2(@RequestParam("id") String id , @RequestParam("name") String name) {
        return dcClient.dcx2(id,name);
    }
}
